import { _post, _get, _put } from '../request';
// 获取商品分类
export function getCategoryList(data) {
  return _get({
    url: `crm/pt/product-classifys/action/list`,
    data,
  });
}
// 新增分类
export const addCategory = (data) => {
  return _post({
    url: `crm/pv/product-classifys/action/create`,
    data,
  });
};
// 编辑分类
export const editCategory = (data) => {
  return _put({
    url: `crm/pt/product-classifys/action/update`,
    data,
  });
};
// 删除分类
export const delCategory = (data) => {
  return _put({
    url: `crm/pt/product-classifys/action/operator`,
    data: {
      ...data,
      opType: 1,
    },
  });
};
// 获取单个详情
export const getCategoryDetail = (data) => {
  return _post({
    url: 'crm/pt/products/action/list-page',
    data,
  });
};
